This page last changed on Jan 14, 2005 by eblack.

 
I pull an updated file from the server onto my machine, does it overwrite my earlier version or archive it somehow?

CVS is pretty smart in that regard, but not completely flawless. If your local file is different from the one on the server, but the changes in the file are on different lines, it will try to merge the changes in your copy with the one it downloads. But, if the changes are on the same line, it will report a conflict and will ask you to manually fix it. It will mark the conflicting lines like this:

<<<<<<< build.xml
<project default="jar_in_time" name="framework" basedir=".">
=======
<project default="jar_for_test" name="framework" basedir=".">
>>>>>>> 1.15

Where the <<<<<< build.xml and the line following are indicating the local file and >>>>> 1.15 and the line above is indicating the version on the server. If there are alot of differences, you would have to search for the shift symbols(> or <). This also doesn't work with binary files, such as word documents or image files. That is why you want to get in the habit of updating whenever you start working and committing whenever you are through.

 
Yow. That sounds like it would drive me crazy in short order. Is there a way to set a preference so that instead of merging versions, it just saves the earlier version as a backup?
 
It does that normally with the TortoiseCVS client software that you have. It will save a backup of your file named .#<filename>.<yourversion>. You may have to tell Windows Explorer to show hidden files and folders to see the file. You can do that by selecting Tools>Folder Options... within Windows Explorer, then the View tab and click 'Show hidden files and folders', Apply the changes and click OK.

Also, to see what will be updated before doing the real update, you could right click in your working copy and select CVS>Update Special... On the bottom of the dialog box that appears, you can select Simulate update and click ok. That will show you what would be updated and any conflicts that might arise before you do the real update.

There is a free program that will integrate with TortoiseCVS (or work on it's own) called WinMerge that will allow you to see the differences in color highlights, edit the files and save them. The link is http://winmerge.sourceforge.net. It has screen shots. If you want to install it, there is a link that says 'Download WinMerge 2.2 Installer', click on the link to go to the next page to select a mirror site. Once you click the little binary file icon in the download column, the file will be downloaded. After downloading, double click the installer to install it. Then when you want to use it with Tortoise, if you have a file with conflicts (the file will have a little red box with an exclamation point in it instead of the green box with a check) and you right click on the file, there will be a 'CVS Resolve Conflicts...' menu item. Click that to start WinMerge with the files to compare already loaded(you'll have to double click the file in a little dialog box that pops up). Incidently, WinMerge will create a copy of both files to compare called <file>.yours.<extension> and <file>.mine.<extension> in your Documents and Settings\<username>\Local Settings\Temp\<tempdirectory> folder so you can save them elsewhere if you'd want to. These temp files are in a hidden folder(see above) and will be deleted after WinMerge has stopped running. WinMerge is also useful on it's own as a difference editor which everyone needs occasionally.

 
How does CVS know not to diff binary files like Word docs?

The CVS server can be setup to handle binary files differently than text files. CVS will know if a binary file is different than another version, but will not be able to tell how. There are also other advanced features that are disabled/enabled by indicating binary file types on the server. Some common binary file types that are set on our CVS servers are:

*.gif
*.jpg
*.png
*.pdf
*.mov
*.wmv
*.rm
*.ram
*.doc
*.jar

 
I'm a little confused about what to do with CVS when I want to move a file into a different folder, such as into the Older Versions folder.  If I just move it on my own machine, CVS copies it from the server back into the original location.  Is there a CVS "move" command?

There is a cvs move command but not in the TortoiseCVS client program you are using. The easiest method of moving a file is:

1. Copy file to new location
2. Use CVS add on the copied file to add it to the server in the new location
3. Use CVS remove to delete the old file from your system and the server
4. Use CVS commit to save the changes on the server(both add and removal of two files)

 
We'd like to change the folder names on CVS. What's the best way to do this?

Renaming directories is not very easy, especially if there are alot of subdirectories. It is done sort of the same way as renaming files, where you copy the file to the new name, add the newly named file(cvs add), remove the old named file(cvs remove), and commit the changes(cvs commit). Doing the entire directory is similiar:

1. Copy the directory to the new name
2. Remove the old directory
3. Remove the CVS hidden directories in the new directory and any subdirectories
4. Add the new files and directory(cvs add contents)
5. Commit the changes(cvs commit)
6. Update.

To remove the hidden CVS files, you need to be able to see them. Most users have hiddden files and directories unviewable. To view them, you need to open Windows Explorer, select Tools>Folder Options..., select the View tab and click "Show hidden files and folders" (6th item in Advanced settings list box).

CVS history will start from the renaming point, although it is available through the original name for history prior to the renaming.

 

Folders are disappearing. I can create and add them, and they appear briefly with a little green tag (even though I haven't committed), but then they disappear.

The disappearing folder problem is due to a default option for cvs update that prunes(deletes) empty folders. To shut that off:

  1. Right-click in a Windows Explorer window
  2. Select CVS>Preferences...
  3. Select the Policy tab
  4. Deselect the Prune empty folders option
  5. Click OK.

 
Do you know if the TortiseCVS client uses the -d flag for updates? That's the one that brings down new directories from the server if they don't exist on the local machine. The default is to not do it.

By default, yes. But that can also be disabled through the preferences.

 

Very nice! I especially love "Yow. That sounds like it would drive me crazy in short order." The "move" instructions are very straightforward. I wonder if we should make those more visible somehow?

Posted by pburney at Dec 27, 2004 22:15

I want to rename the folder (which has many sub folders), and i have to maintain the history.

What is the best way to do it

Posted by at Oct 08, 2008 08:37

how can i take backup for Tortoise CVS

Posted by at Mar 31, 2009 10:19
Document generated by Confluence on Jan 27, 2014 16:57